# Contributor: knuxify <knuxify@gmail.com>
# Maintainer: knuxify <knuxify@gmail.com>
pkgname=blueman
pkgver=2.3
pkgrel=1
pkgdesc="GTK+ Bluetooth Manager"
url="https://github.com/blueman-project/blueman"
arch="all !s390x !riscv64" # blocked by networkmanager/polkit
license="GPL-3.0-or-later"
depends="bluez dbus gtk+3.0 python3 py3-cairo py3-gobject3"
makedepends="
	autoconf
	automake
	bluez-dev
	cython
	glib-dev
	libtool
	polkit-dev
	python3-dev
	py3-gobject3-dev
	"
checkdepends="networkmanager libpulse-mainloop-glib"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://github.com/blueman-project/blueman/releases/download/$pkgver/blueman-$pkgver.tar.xz
	dont-rerun-plugin-tests.patch"

prepare() {
	default_prepare
	# configure thinks that Python 3.10 is Python 3.1, this fixes it
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-schemas-compile
	make
}

check() {
	PYTHONPATH=module/.libs python3 -m unittest
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
c0b1db372bdf6b3d4910e4f20bf27f8bb6ed6a68656d3557fb4692ea2126eb3bb9c3d6814fed1fc92e4d04bfcc6f6819bdbeac186763a2627e518f2f227839b6  blueman-2.3.tar.xz
a3ec5d05c0f32353c1eb933bf1acdcc1f8bede31c12132bd6b30adb46111ef88b7586f9f7c574a95b9dd4877f3977514389e2b565c1029835db920f30a01fb72  dont-rerun-plugin-tests.patch
"
